theory of machines for gate